#!/usr/bin/env python
# coding=utf-8
"""
# @Created on : 2016/05/01 15:07
# @Author     : ldf (ldf@eehello.com)
# @Link       : http://www.eehello.com
# @Version    : 
# 本程序在python2.7下测试通过
"""


import socket

ip_port = ('127.0.0.1',8888)

sk = socket.socket()

sk.connect(ip_port)

flag = 1

while flag:
    data = sk.recv(1024)
    print data
    a = raw_input()
    sk.sendall(a)
    if a == 'exit':
        flag = 0

sk.close()
